﻿@{
    ViewBag.Title = "编辑用户";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
@model UserDto
<div class="row">
    @using (Html.BeginHBootstrap_Box("新增用户"))
    {
        using (Html.BeginForm("Edit", "User", FormMethod.Post, new { id = "postForm", @class = "form-horizontal", onsubmit = "return validateCallback(this,navTabAjaxDone)" }))
        {
        @Html.HiddenFor(m => m.Id)
        @Html.HiddenFor(m => m.PassWord)
        @Html.HiddenFor(m => m.LoginNo)
        <div class="form-group">
            <label class="col-sm-3 control-label">
                <span class="text-danger">*</span>名称：</label>
            <div class="col-sm-8">
                @Html.TextBoxFor(m => m.ShortName, new { @class = "form-control" })
                @Html.ValidationMessageFor(m => m.ShortName)
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">
                <span class="text-danger">*</span>角色：</label>
            <div class="col-sm-8">
                @Html.DropDownListFor(m => m.RoleId, Model.RoleList, new { @class = "form-control chosen-select" })
                @Html.ValidationMessageFor(m => m.RoleId)
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">
                <span class="text-danger">*</span>登录账号：</label>
            <div class="col-sm-8">
                <span class="text-info form-control">@Model.LoginNo</span>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">
                修改密码：</label>
            <div class="col-sm-8">
                <input class="form-control" data-val="true" data-val-length="密码长度6-20位" data-val-length-max="20"
                    data-val-length-min="6" id="NewPassWord" name="NewPassWord" type="password">
                <span class="field-validation-valid" data-valmsg-for="NewPassWord" data-valmsg-replace="true">
                </span><span class="help-block m-b-none"><i class="fa fa-info-circle"></i>如果要修改密码，请输入新密码</span>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">
                联系方式：</label>
            <div class="col-sm-8">
                @Html.TextBoxFor(m => m.Contact, new { @class = "form-control" })
                @Html.ValidationMessageFor(m => m.Contact)
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">
                是否启用：</label>
            <div class="col-sm-8">
                @Html.CheckBoxFor(m => m.IsActive, new { @class = "js-switch" })
            </div>
        </div>
               
        <div class="form-group">
            <div class="col-sm-4 col-sm-offset-3">
                <button class="btn btn-primary" type="submit">
                    提交</button>
                <a class="btn btn-default" type="button" href="@Url.Action("Index", "User")" >取消</a>
            </div>
        </div>
        }
    }
</div>